 diff --git a/CMakeLists.txt b/CMakeLists.txt
-index 8df871c..a18ef76 100644
+index 8df871c..4fe9da9 100644
 --- a/CMakeLists.txt
 +++ b/CMakeLists.txt
-@@ -35,13 +35,27 @@ INCLUDE_DIRECTORIES(AFTER ${CMAKE_BINARY_DIR} ${yasm_SOURCE_DIR})
+@@ -35,13 +35,28 @@ INCLUDE_DIRECTORIES(AFTER ${CMAKE_BINARY_DIR} ${yasm_SOURCE_DIR})
  
  INCLUDE(ConfigureChecks.cmake)
  
 +OPTION(INSTALL_YASM_ONLY "Only install the yasm executable" OFF)
++IF(INSTALL_YASM_ONLY)
++  SET(OPT_INSTALL EXCLUDE_FROM_ALL)
++ELSE()
++  SET(OPT_INSTALL)
++ENDIF()
 +
 +IF(DEFINED YASM_VER)
 +  SET(ver _${YASM_VER})

 ENDIF(BUILD_SHARED_LIBS)
 
-INSTALL(TARGETS libyasm
+IF(NOT INSTALL_YASM_ONLY)
+
+INSTALL(TARGETS libyasm EXPORT ${targetsFile}
     RUNTIME DESTINATION bin
     LIBRARY DESTINATION lib
     ARCHIVE DESTINATION lib
@@ -76,5 +79,7 @@ INSTALL(FILES
     symrec.h
     valparam.h
     value.h
-    DESTINATION include/libyasm
+    DESTINATION include${verDir}/libyasm
     )
+
+ENDIF(INSTALL_YASM_ONLY)

+
+INSTALL(TARGETS yasm EXPORT ${targetsFile} RUNTIME DESTINATION bin)
diff --git a/libyasm/CMakeLists.txt b/libyasm/CMakeLists.txt
index bd9b7b2..979e8c0 100644
--- a/libyasm/CMakeLists.txt
+++ b/libyasm/CMakeLists.txt
@@ -38,14 +38,16 @@ IF(BUILD_SHARED_LIBS)
         )
 ELSE(BUILD_SHARED_LIBS)
     SET_TARGET_PROPERTIES(libyasm PROPERTIES
